#!/bin/sh

#= auto build example

## hyphop ##

set -e
cd "$(dirname "$0")"

#export LINUX_VER=linux-5.7.7

. ./config.conf

export KERNEL_SOURCE_DIR="$KERNEL_SOURCE_DIR"

./$kernel_prepare

CHK=1 ./patch_ || {
#./patch_ ../patches/$LINUX_VER/*.patch 
./patch_ ../patches/$LINUX_VER*/*.patch 
./patch_ ../patches/linux-krescue/*.patch
LAST=1 ./patch_
}

./make_kernel_mainline_vimsX -n
./kernel_config ../files/configs/mmc_y
./kernel_config ../files/configs/eth2_y
./kernel_config ../files/configs/usb_storage_y
./kernel_config ../files/configs/small_size_n

NOPOST=1 ./make_kernel_mainline_vimsX dtbs || echo "[w] ups...">&2

./make_kernel_mainline_vimsX

TAR=1 IPK=1 ./make_kernel_mainline_vimsX_modules
./make_kernel_opkgs